package com.example.chirdrenserver.Pojo.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.checkerframework.checker.units.qual.A;

import java.time.LocalDateTime;

/**
 * @Author: Yu
 * @CreateTime: 2025-07-03
 * @Description:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Post {
    private static final long serialVersionUID = 1L;
    @TableId(value = "post_id", type = IdType.AUTO)
    Long postId;

    Long userId;

    String title;

    String content;

    Integer postType;  //0为文章 1为图片  2为视频
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime createTime;

    Long fileId;

}
